<?php $this->action("index","more","header");?>
<script>
Do(function(){
	
		
	  	$(".UIMG").each(function(i){
	  		
	   		getImageInfo(this);
	   		
		 });
		function getImageInfo(obj)
		{	
			
			var img = new Image();
			img.src = $(obj).attr("isrc");
			
			if (img.complete) { 
		        callback.call(img, obj);
		        return; 
		    }
			img.onload = function(){ 
		  		callback.call(img, obj);
		   
			};
			img.onerror = function()
			{
		
				obj.src='/pics/blank.gif';
				obj.width=0;
				obj.height=0;
		
			}
		}
		
		
		function callback(obj)
		{
			
			
			   var  nWidth = $(obj).attr("iw");
			   var  nHeight = $(obj).attr("ih");
		       var w , h , p1 , p2 ;
		       //计算宽和高的比例
		       if(this.width > nWidth)
		       {
			       p1 = nWidth / nHeight ;
			       p2 = this.width / this.height ;
					
			       w = 0 ; h = 0 ;
			       if( p1 < p2 )
			       {
			           //按宽度来计算新图片的宽和高
			           w = nWidth ;
			           h = nWidth * ( 1 / p2 ) ;
			       }
			       else
			       {
			           //按高度来计算新图片的宽和高
			           h = nHeight ;
			           w = nHeight * p2 ;
			       }
		     	}
		     	else
		     	{
		     		w = this.widht;
		     		h = this.height;
		     	}
			obj.src = this.src;
			obj.widht= w;
			obj.height=h;
		} 
		 
});


</script>
	<div id="content">
		<div class="main">
			<?php if(!empty($mod_list['l'])) foreach($mod_list['l'] as $k => $v)
			{
			$modname = ucwords($v->widgetname);
			echo $this->_helper->Helper_ShowMod_Tpl->$modname($v);
			}
			?>
	     </div><!-- main end -->
	     <div class="aside">
			<div class="mod" id="sp-user">
			    <div class="bd">
			        <div class="user-pic">
			        <a href="#" id="no-pic"><img id="u_pic"  src="<?php $logo =  $site_E->logo;if(empty($logo)) echo "/pics/site/icon_default_large.png"; else echo $site_E->getLargelogo();?>" ></a>
			        </div>
			        <?php  if($_SESSION['sign'] == $site_E->mapUser->sign && $RootOper != '1'){?>
			        <div class="site-follow">
			        
		        	<?php if(!$isfollow){ ?>
				            <a id="like" href="#" class="lnk-follow">关注</a>
				    <?php } else { ?>      
           				 <span>我喜欢这个小站。</span>
           				 <span><a  class="lnk-unfollow" href="#" id="unlike">&gt;取消</a></span>
           		    <?php }?>
			        </div>
			        <?php }?>
			        <div class="desc">
			            <?php echo $site_E->descript;?>
			        </div>
			        <div class="site-info">
			        </div>
			    </div>
			
			</div>	    
			
			<div class="mod" id="db-followers">
				  <div class="hd">
				    <h2>
				        <span>关注该小站的人</span>
				        <span class="pl">
				        </span>
				    </h2>
				  </div>
				  <div class="bd">
					<ul class="list-s">
					    <?php if(!empty($sina_follow_list)) foreach($sina_follow_list as $k => $v){?>
					    <li>
					    <div class="pic">
					        <a class="nbg" target="_blank" href="<?php echo $v['href'];?>"><img title="@<?php echo $v['name'];?>" class="imgg" src="<?php echo $v['image'];?>"></a> 
					    </div>
					    
					    </li>
					    <?php }?>
					</ul>
				  </div>
		</div>
			<?php if($RootOper == 1){?>
			<script type="text/javascript">
			    var mine_page_url="/j/site/120150/layout";
			    var aside = false;
			   Do('/style/js/lib/jquery-ui-sortable.js','/style/js/lib/mod_dragdrop2.js');
			</script>
			
			<script>
			Do(function () {
		        var srcNoPic = $('#u_pic').attr('src'),
		            srcAddPic = '/pics/site/icon_default_large_hover.png';
		
		        $('#no-pic').hover(
		            function () { $('img', this).attr('src', srcAddPic); },
		            function () { $('img', this).attr('src', srcNoPic); }
		        ).click(function (e) {
         		   e.preventDefault();
         		   location.href = '/admin_icon/' + $('body').attr('id') + '/';
     		   });
	        });
			
			</script>
			<?php }?>
			<script>
			Do('dialog', function () {
			var login = <?php echo $is_login;?>;
	         $('#like').click(function (e) {
	            e.preventDefault();
	            var site_id = $("body").attr('id');
	            
	            if(login){
	            
		            $.post_withck(
		                '/like/'+site_id+'/1',
		                function (o) {
		                   location.reload(1);
		                }
		            );
	            }
	            else
	            {
	            	 var dlg = dui.Dialog({
                            width: 300,
                           
                          	 content:'请先登录',
                             buttons: 
                             [{  text: '确定',
				                 method: function (o) {
				      					location.href='/token/';                  
				                        }  
				             }]
                        }).open();
                    
	            }
	        });
	
	        /* cancel like*/
	        $('#unlike').click(function (e) {
	            e.preventDefault();
	            var site_id = $("body").attr('id')
	            if(login){
	            
		            $.post_withck(
		                '/like/'+site_id+'/0',
		                function (o) {
		                   location.reload(1);
		                }
		            );
	            }
	            else
	            {
	            	 var dlg = dui.Dialog({
                            width: 300,
                           
                          	 content:'请先登录',
                             buttons: 
                             [{  text: '确定',
				                 method: function (o) {
				      					location.href='/token/';                  
				                        }  
				             }]
                        }).open();
                    
	            }
	        });
	    });
		</script>		
			
	     </div><!-- aside end -->
	</div><!-- content end -->
<?php $this->partial("/Tpl/Index/MoreAction/doFooter.htm");?>    
</body>
</html>